// 
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2005 - 2014 Media Design School
//
// File Name	: HumanView.h
// Desrciption	: CHumanView declaration file.
// Author		: Hayden Asplet.
// Mail			: hayden.asplet@mediadesignschool.com
//

// PCH
#include "GameStd.h"

// Library Includes

// This Include
#include "HumanView.h"

// Local Includes

CHumanView::CHumanView()
	:m_objectId(g_kINVALID_OBJECT_ID),
	m_bIsLMBDown(false),
	m_bIsRMBDown(false)
{
	m_mouseCursorPosition = CPoint(0, 0);

	memset(m_bKeys, false, sizeof(m_bKeys));
}

CHumanView::~CHumanView()
{

}

void CHumanView::VUpdate(float _fDeltaTime)
{

}

void CHumanView::VRender(float _fDeltaTime)
{
}

bool CHumanView::VMsgProc(const CAppMsg& _krMsg)
{
	switch(_krMsg.m_uMsg) {
		case WM_KEYDOWN: {
			m_bKeys[_krMsg.m_wParam] = true;

			return true;
			break;
		}
		case WM_KEYUP: {
			m_bKeys[_krMsg.m_wParam] = false;
			return true;

			break;
		}
		case WM_MOUSEMOVE: {
			m_mouseCursorPosition = CPoint(LOWORD(_krMsg.m_lParam), HIWORD(_krMsg.m_wParam));
			return true;

			break;
		}
		case WM_LBUTTONDOWN: {
			m_bIsLMBDown = true;
			return true;

			break;
		}
		case WM_LBUTTONUP: {
			m_bIsLMBDown = false;
			return true;

			break;
		}
		case WM_RBUTTONDOWN: {
			m_bIsRMBDown = true;
			return true;

			break;
		}
		case WM_RBUTTONUP: {
			m_bIsRMBDown = false;
			return true;

			break;
		}
		default: break;
	}

	return false;
}

void CHumanView::VAttach(TGameObjectId _id)
{
	m_objectId = _id;
}
